Skip to content

feat: AST pretty-printer #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Dec 1, 2024

Closes #27

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approach is fine, we can also make individual methods public, eg for expr

@klkvr
Copy link
Member Author

klkvr commented Dec 8, 2024

@DaniPopes this should be complete, though no tests yet — unsure if we need those and what'd be the best approach to write them

should we add some helpers to check whether two ASTs are identical?

@klkvr klkvr marked this pull request as ready for review December 8, 2024 22:08
@klkvr klkvr requested a review from onbjerg as a code owner December 8, 2024 22:08
@klkvr klkvr changed the title [wip] feat: AST pretty-printer feat: AST pretty-printer Dec 8, 2024
@TilakMaddy
Copy link
Contributor

I was thinking if there's a method on ast nodes to "peek" into the relevant portion of the source code that would be great too

@DaniPopes
Copy link
Member

DaniPopes commented Dec 10, 2024

this should be complete, though no tests yet — unsure if we need those and what'd be the best approach to write them

You can add a -Z flag only used in these tests that re-parses pretty printed code; it should also print it to stdout so it gets checked out in a stdout file
I don't think asserting equality is necessary

I was thinking if there's a method on ast nodes to "peek" into the relevant portion of the source code that would be great too

Please check out the SourceMap APIs, I don't know what this has to do with this PR however

@Bisht13
Copy link

Bisht13 commented Apr 17, 2025

Is this PR pending because of lack of tests? Wanted to help get this PR cross the line

@DaniPopes
Copy link
Member

I'm currently in the process of rewriting forge fmt using solar, I believe we will be able to upstream that implementation so closing for now

@DaniPopes DaniPopes closed this Apr 18, 2025
@wtdcode
Copy link

wtdcode commented May 21, 2025

I'm currently in the process of rewriting forge fmt using solar, I believe we will be able to upstream that implementation so closing for now

Hi! Any progress for the new implementation? Or is it open-sourced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a simple AST pretty-printer
5 participants